fix(library-select): drop framework libs shadowed by project headers; release v2.2.5#265
Conversation
… release v2.2.5 Closes #263. ## The regression fbuild 2.2.4 broke ALL teensy41 examples on FastLED's CI: every example link-fails with multiple-definition errors on every FastLED symbol. Root cause: the LDF resolver (introduced as `perf(library-select)` in PR #237) selects the framework's bundled FastLED library at `cores/teensy4/.../libraries/FastLED/` even when the user's project ships its own FastLED. The bundled library's source files get appended to `core_sources` (teensy orchestrator.rs:207), get compiled into the build, and produce duplicate symbols at link time. The path-prefix attribution in `fbuild-library-select::resolve` can mis-attribute a `#include <FastLED.h>` when the user's transitive includes resolve into the bundled library — even though the user's project owns `FastLED.h` directly. ## The fix New `filter_framework_libs_shadowed_by_project(libraries, roots)` in `framework_libs.rs` drops any framework library whose primary header (`<lib_name>.h`) is shadowed by a same-basename header anywhere under the project's include roots. Applied at the start of both the cached and non-cached resolver paths. Conservative: only drops a library when the project itself ships a header matching the library's canonical name. Other framework libraries (SPI, Wire, etc.) are unaffected. ## Tests - `project_is_the_library_does_not_pull_in_bundled_copy` — the simpler case (project src/FastLED.h, framework libraries/FastLED/); passed before the fix too (the resolver handled this case via path-prefix attribution) but stays as a regression gate. - `example_only_root_does_not_pull_in_bundled_fastled_when_user_owns_fastled` — the failing case (per-example walker root doesn't see the repo's src/, but the user owns FastLED at a higher level). Demonstrates the filter dropping the bundled library before the resolver runs. Full workspace cargo check / clippy / fmt / test all green. ## Release v2.2.5 Patch release rolling up: - THIS fix (#263 regression repair) - The LTO-tmpdir fix from #261 / PR #262 (Windows MSYS `mv` path collapse) Cargo.toml + pyproject.toml bumped to 2.2.5. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (3)
📝 WalkthroughWalkthroughVersion 2.2.5 release adds a defensive filtering step to framework library source resolution. The resolver now drops bundled framework libraries when the project provides headers with matching canonical names, preventing unintended duplication of headers like FastLED.h when users shadow bundled copies. ChangesFramework Library Shadowing and Version Release
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related issues
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Closes #263. Cuts release v2.2.5.
The regression
fbuild 2.2.4 broke ALL teensy41 examples on FastLED's CI: every example link-fails with multiple-definition errors on every FastLED symbol. The bundled FastLED at
cores/teensy4/.../libraries/FastLED/gets compiled into the build alongside the user's local FastLED.Root cause: the LDF resolver introduced in PR #237 (
perf(library-select): parallel BFS walker) can select the framework's bundled FastLED when the user's project ships its own. The bundled library's source files get appended tocore_sources(teensy/orchestrator.rs:207) and produce duplicate symbols at link.Path-prefix attribution in
fbuild-library-select::resolvemis-attributes a transitive#includeresolving into the bundled library — even though the user's project ownsFastLED.hdirectly.The fix
New
filter_framework_libs_shadowed_by_project(libraries, roots)inframework_libs.rsdrops any framework library whose primary header (<lib_name>.h) is shadowed by a same-basename header under the project's include roots. Applied at the start of both the cached and non-cached resolver paths.Conservative: only drops a library when the project ships a header matching the library's canonical name. SPI, Wire, OctoWS2811, etc. are unaffected.
Tests
project_is_the_library_does_not_pull_in_bundled_copy— simpler case (project src/FastLED.h, framework libraries/FastLED/). Passed before too (the resolver's path-prefix attribution handles it) but stays as a regression gate.example_only_root_does_not_pull_in_bundled_fastled_when_user_owns_fastled— the failing case. Filter drops the bundled library before the resolver runs.Release v2.2.5
Patch release rolling up:
mvpath collapse)Cargo.toml + pyproject.toml bumped to 2.2.5. On merge,
release-auto.ymltriggers automatically (paths includeCargo.tomlandpyproject.toml).Test plan
soldr cargo check --workspace --all-targets— cleansoldr cargo clippy --workspace --all-targets -- -D warnings— cleansoldr cargo fmt --all -- --check— cleansoldr cargo test --workspace— all green, includes both new regression testsrelease-auto.ymlships v2.2.5 to PyPI + GitHubfbuild==2.2.5🤖 Generated with Claude Code
Summary by CodeRabbit
Release Notes v2.2.5
Bug Fixes
Tests
Chores